/*

Copyright 2007 Renaun Erickson (http://renaun.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

@ignore
*/
package asfslib.api.familytree.v1
{
/**
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="occurringAssertion">
 *   &lt;complexContent>
 *     &lt;extension base="{http://api.familysearch.org/familytree/v1}assertion">
 *       &lt;sequence>
 *         &lt;element name="date" type="{http://api.familysearch.org/familytree/v1}date" minOccurs="0"/>
 *         &lt;element name="place" type="{http://api.familysearch.org/familytree/v1}place" minOccurs="0"/>
 *       &lt;/sequence>
 *       &lt;attribute name="scope" type="{http://api.familysearch.org/familytree/v1}scope" />
 *     &lt;/extension>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
public class OccurringAssertion extends Assertion
{

    //----------------------------------
    //  date
    //----------------------------------

    /**
     *  @private
     *  Storage for the date property.
     */
    private var _date:DateInformation;

    /**
     *  The date property
     *
     *  @default 
     */
    public function get date():DateInformation
    {
        return _date;
    }

    /**
     *  @private
     */
    public function set date(value:DateInformation):void
    {
        _date = value;
    }


    //----------------------------------
    //  place
    //----------------------------------

    /**
     *  @private
     *  Storage for the place property.
     */
    private var _place:Place;

    /**
     *  The place property
     *
     *  @default 
     */
    public function get place():Place
    {
        return _place;
    }

    /**
     *  @private
     */
    public function set place(value:Place):void
    {
        _place = value;
    }


    //----------------------------------
    //  scope
    //----------------------------------

    /**
     *  @private
     *  Storage for the scope property.
     */
    private var _scope:Scope;

    /**
     *  The scope property
     *
     *  @default 
     */
    public function get scope():Scope
    {
        return _scope;
    }

    /**
     *  @private
     */
    public function set scope(value:Scope):void
    {
        _scope = value;
    }


    //----------------------------------
    //
    //  Methods
    //
    //----------------------------------
	
	/**
	 * 	Make a clone of this instance
	 */
    override public function clone():Assertion
    {
    	// Need copy method to allow for typed clones and inheritance
    	var target:OccurringAssertion = new OccurringAssertion();
        copy(target);
        return target;
    }	

	/**
	 * 	Make a clone of this instance
	 */
    override protected function copy(target:Assertion):void
    {
    	super.copy(target);
    	var occuringAssertion:OccurringAssertion = target as OccurringAssertion;
    	
        var newDate:DateInformation = null;
        var newPlace:Place = null;
        
        if (date != null) 
        {
            newDate = date.clone();
        }

        if (place != null) 
        {
            newPlace = place.clone();
        }
        
        occuringAssertion.date = newDate;
        occuringAssertion.place = newPlace;
        occuringAssertion.scope = scope;
    }
    
}
}
